using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.DAL.DBManagers;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
	#region IPaymentMethodService

	/// <summary>
	/// PaymentMethodService object for Ibatis mapped table 'PaymentMethod'.
	/// </summary>
	public class IPaymentMethodService : BaseSqlMapDao
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(IPaymentMethodService).Name);
	  	
		public IList<PaymentMethodEntity> LoadAll()
        {
            try
            {
                return ExecuteQueryForList< PaymentMethodEntity>("PaymentMethodLoadAll", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
       public PaymentMethodEntity LoadByPrimaryKey(PaymentMethodEntity objE)
        {
            try
            {
                return ExecuteQueryForObject< PaymentMethodEntity>("PaymentMethodLoadByPrimaryKey", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
        
        /// <summary>
        /// add new PaymentMethod to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Insert(PaymentMethodEntity objE)
        {
            try
            {
                ExecuteInsert("PaymentMethodInsert", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// update PaymentMethod to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Update(PaymentMethodEntity objE)
        {
            try
            {
                ExecuteUpdate("PaymentMethodUpdate", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// delete PaymentMethod to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Delete(PaymentMethodEntity objE)
        {
            try
            {
                ExecuteDelete("PaymentMethodDelete", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
	}
	#endregion  
}
